﻿#region Disclaimer/Info
///////////////////////////////////////////////////////////////////////////////////////////////////
// MetaCollection
// 
// MetaCollection is a system to provide a standard structure, permissions and metadata service
// for content organization.
//
// This project is hosted at Google Code at http://code.google.com/p/metacollection/
//
// This project is licensed under the BSD license.  See the License.txt file for more information.
///////////////////////////////////////////////////////////////////////////////////////////////////
#endregion

using System.Xml.Linq;
using MetaCollection.ContentService.Http;
using MetaCollection.Framework.Model;
using System;
using System.Collections.Generic;

namespace MetaCollection.ContentService.WebDav
{
	/// <summary>
	/// A Resource Property
	/// </summary>
	public interface IResourceProperty
	{
		/// <summary>
		/// Gets the name of this property.
		/// </summary>
		/// <value>The name of this property.</value>
		XName Name { get; }
		/// <summary>
		/// Gets the name of the item property that this resource property is associated with.
		/// </summary>
		/// <value>The name of the item property.</value>
		string ItemPropertyName { get; }
		/// <summary>
		/// Gets the data value selector.  The data value selector is a function that 
		/// selects data elements from a dictionary of web dav property data.
		/// </summary>
		/// <value>The data value selector.</value>
		Func<KeyValuePair<string, object>, bool> DataValueSelector { get; }
		/// <summary>
		/// Returns an XElement that represents the property
		/// </summary>
		/// <param name="sourceItem">The source item.</param>
		/// <param name="requestType">Type of the request.</param>
		/// <returns>An XElement representing this ResourceProperty</returns>
		XElement[] Element(IEnumerable<object> data);
	}
}
